package com.threegroup.web.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;
@Document(indexName = "flavor", shards = 5, replicas = 1, createIndex = true)
public class FlavorES {
    /**
     * 主键
     */
    @Id
    @JsonFormat
    private Long id;
    /**
     * 菜品
     */
    @Field(type = FieldType.Long)
    @JsonFormat
    private Long dishId;
    /**
     * 口味名称
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @JsonFormat
    private String name;
    /**
     * 口味数据list
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @JsonFormat
    private String value;
    /**
     * 创建人
     */
    @Field(type = FieldType.Long)
    @JsonFormat
    private Long creator;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Field(type = FieldType.Date_Nanos)
    private Date createDate;
    /**
     * 修改人
     */
    @Field(type = FieldType.Long)
    @JsonFormat
    private Long updater;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Field(type = FieldType.Date_Nanos)
    private Date updateDate;
    /**
     * 是否删除
     */
    @Field(type = FieldType.Integer)
    @JsonFormat
    private Integer isDeleted;

    @Override
    public String toString() {
        return "FlavorES{" +
                "id=" + id +
                ", dishId=" + dishId +
                ", name='" + name + '\'' +
                ", value='" + value + '\'' +
                ", creator=" + creator +
                ", createDate=" + createDate +
                ", updater=" + updater +
                ", updateDate=" + updateDate +
                ", isDeleted=" + isDeleted +
                '}';
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getDishId() {
        return dishId;
    }

    public void setDishId(Long dishId) {
        this.dishId = dishId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Long getCreator() {
        return creator;
    }

    public void setCreator(Long creator) {
        this.creator = creator;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Long getUpdater() {
        return updater;
    }

    public void setUpdater(Long updater) {
        this.updater = updater;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }
}
